package com.qd.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_operator_log")
public class OperatorLog extends Model<OperatorLog> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_ID)
    private String logId;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;
    /**
     * 用户姓名
     */
    @TableField("user_name")
    private String userName;
    /**
     * IP地址
     */
    @TableField("user_ip")
    private String userIp;
    /**
     * 模块标题
     */
    @TableField("title")
    private String title;
    /**
     * 方法名称
     */
    @TableField("method")
    private String method;
    /**
     * 登录类型:电脑端或者手机端
     */
    @TableField("remote")
    private String remote;
    /**
     * 请求方式
     */
    @TableField("request_method")
    private String requestMethod;
    /**
     * 操作类型
     */
    @TableField("operator_type")
    private String operatorType;
    /**
     * 组织机构ID
     */
    @TableField("org_id")
    private String orgId;
    /**
     * 组织机构名称
     */
    @TableField("org_name")
    private String orgName;
    /**
     * 请求URL
     */
    @TableField("url")
    private String url;
    /**
     * 请求参数
     */
    @TableField("request_param")
    private String requestParam;
    /**
     * 返回参数
     */
    @TableField("result_param")
    private String resultParam;
    /**
     * 操作状态
     */
    @TableField("status")
    private String status;
    /**
     * 错误消息
     */
    @TableField("error_msg")
    private String errorMsg;
    /**
     * 操作时间
     */
    @TableField("operator_time")
    private LocalDateTime operatorTime;
    /**
     * 接口耗时
     */
    @TableField("interface_time")
    private Long interfaceTime;

    public void freeData() {
        this.logId = null;
        this.userId = null;
        this.userName = null;
        this.userIp = null;
        this.title = null;
        this.method = null;
        this.remote = null;
        this.requestMethod = null;
        this.operatorType = null;
        this.orgId = null;
        this.orgName = null;
        this.url = null;
        this.requestParam = null;
        this.resultParam = null;
        this.status = null;
        this.errorMsg = null;
        this.operatorTime = null;
        this.interfaceTime = null;
    }

}
